import formItem from '@/components/form/form-item'
import { filterProperties } from '@/util'

export default {
  name: 'FormInput',
  mixins: [formItem],
  props: {
    value: [Boolean, String, Array, Number, Object, Date],
    readonly: Boolean,
    disabled: Boolean
  },
  computed: {
    computePlaceholder() {
      return this.placeholder === true ? this.message : this.placeholder
    },
    listeners() {
      return filterProperties(this.$listeners, 'input', false)
    },
    inputDisabled() {
      if (this.formHolder.enabledFields?.includes(this.prop)) {
        return false
      }
      return this.disabled || (this.elForm || {}).disabled
    }
  }
}
